/**
 * author wen
 * cunyu
 * email wjd_13@hotmail.com
 */
package com.cunyu.service;

import cn.tom.kit.StringUtil;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 获取城市/ 城市代码
 * @author win
 * 2019/04/26-13:23
 */
@Service
public class CityService extends BaseService{

    public List<Map<String, Object>> cityList(String pcode){
        String sql = "select code, name from codecity " ;
        if(StringUtil.hasLength(pcode)){
            sql += " where pcode = "+pcode ;
        }
        return getList(sql) ;
    }

    public List<Map<String, Object>> provinceList(){
        String sql = "select code, name from codeProvince" ;
        return getList(sql) ;
    }

}
